﻿@model PinLayoutMVC.Models.QuestionModel
           
@{
    ViewBag.Title = "Question";
}

<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="headerTitle">
    <div class="pageTitle" >Question: @Model.Number</div>

    <div class="eigenlink"> 
       @Html.ActionLink("<-Back|---", "prevQuestion", "Admin", new { Model.ID }, null)
       @Html.ActionLink("---|Next->", "nextQuestion", "Admin", new { Model.ID }, null)
        @Html.ActionLink("Overview", "SurveyDetails", "Admin", new { ID = Model.SurveyID }, null)
    </div>
</div>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend id="eigenTitle">Question: @Model.Number  </legend>

        @Html.HiddenFor(model => model.ID) 
        @Html.HiddenFor(model => model.SurveyID) 

        <div class="editor-label">
            @Html.EditorFor(model => model.Number) Nummer
        </div>

        <div class="editor-field">
            @Html.EditorFor(model => model.Question) Question
            @Html.ValidationMessageFor(model => model.Question)
        </div>
        
        <div class="editor-label">
            @Html.EditorFor(model => model.Description) Question Description
        </div>

        <div class="editor-field">
            @Html.EditorFor(model => model.Type) Type of Question
        </div>
        
        <div class="editor-field">
            @Html.EditorFor(model => model.AllowFeedback) Allow feedback
            @Html.ValidationMessageFor(model => model.AllowFeedback)
        </div>
       
       <div class="editor-field">
            @Html.EditorFor(model => model.FeedbackText) Feedback text
            @Html.ValidationMessageFor(model => model.FeedbackText)
        </div>
    </fieldset>
    
    <input type="submit" id="submitQuestion" value="Submit"  />
}
<br /><br />
 <div class="TabelSizzle">
 Awnsers
        <table>
            <tr>
            <td><div id="eigenTableHeader1"> Number  </div></td>
            <td><div id="eigenTableHeader2"> Text </div></td>
            <td><div id="eigenTableHeader3"> Lead to question </div></td>
            </tr>    
    
 
@foreach (var answer in Model.Answers)
{
    <tr>
        <td>
            @answer.Number
        </td>
        <td>
            @answer.Text
        </td>
        <td>
            @answer.LeadsToQuestion
        </td>
        <td>
           @Html.ActionLink("Edit", "Answer", "Admin", new { answer.ID }, null)
        </td>
    </tr>
}

</table>

</div>